package com.shu.mq;

import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

/**
 * @author ssm
 * @version V1.0
 * @description:
 * @date 2020/9/14 14:40
 */

public class ConnectionUtils {

    public static Connection getConnection() throws IOException, TimeoutException {
        ConnectionFactory connectionFactory = new ConnectionFactory();
        connectionFactory.setHost("aic.sairobo.cn");
        connectionFactory.setPort(5672);
        connectionFactory.setVirtualHost("/edu-bc-live");
        connectionFactory.setUsername("admin");
        connectionFactory.setPassword("sairobo007");
        return connectionFactory.newConnection();
    }
}
